package com.ophiux.common.core.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @desc: 数据库实体基类
 * @author: hhl
 * @date：2022/6/21 16:27
 */
@Data
public class BaseEntity implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;


    @ApiModelProperty(value="创建人")
    @TableField(value = "created_by",fill = FieldFill.INSERT)
    private Integer createdBy;

    /**
     * 创建时间
     */
    @ApiModelProperty(value="创建时间")
    @TableField(value = "created_time",fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @ApiModelProperty(value="更新人")
    @TableField(value = "updated_by",fill = FieldFill.UPDATE)
    private Integer updatedBy;

    /**
     * 更新时间
     */
    @ApiModelProperty(value="更新时间")
    @TableField(value = "updated_time",fill = FieldFill.UPDATE)
    private LocalDateTime updatedTime;
}
